{
  "$schema" : "http://json-schema.org/draft/2019-09/schema#",
  "title" : "External Reference Upload Load Response",
  "type" : "object",
  "additionalProperties" : false,
  "properties" : {
    "interfaceCategory" : {
      "type" : "string",
      "enum" : [ "External Data" ],
      "description" : "CMP categorisation of the job associated with this file"
    },
    "interfaceType" : {
      "type" : "string",
      "enum" : [ "External Reference" ],
      "description" : "Sub-categorisation of the job"
    },
    "version" : {
      "type" : "number",
      "minimum" : 0.0,
      "maximum" : 99.99,
      "description" : "The current version of the generic extract file. This must match the corresponding outbound file."
    },
    "details" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/ExternalReferenceUploadLoadResponseDetail"
      }
    },
    "externalFileName" : {
      "type" : "string",
      "pattern" : "^([a-zA-Z0-9._-])+$",
      "maxLength" : 100,
      "description" : "Third party file name"
    },
    "transformDateAndTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Indicates when a third-party file was transformed into the format required by CMP"
    },
    "transmitDateAndTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Indicates when a file was sent to or received from a third-party system"
    }
  },
  "required" : [ "interfaceCategory", "interfaceType", "version", "externalFileName" ],
  "definitions" : {
    "ExternalReferenceUploadLoadResponseDetail" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "referenceType" : {
          "type" : "string",
          "enum" : [ "ACCOUNT", "INVOICE", "SUBSCRIPTION", "PURCHASE" ],
          "description" : "This represents the type of CMP entity that the external reference has been mapped to"
        },
        "internalReference" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "This represents the actual CMP entity the external reference relates to"
        },
        "externalReference" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "This represents the third party reference that is to be stored in CMP"
        }
      },
      "required" : [ "referenceType", "internalReference", "externalReference" ]
    }
  }
}